package com.dxl.consumer.direct;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * Description: TODO
 *
 * @author: Yingyu Wei
 * <p>File Created at 2021/5/2</p>
 */
@Component
public class InfoConsumer {


    @RabbitListener(bindings = @QueueBinding(
            value = @Queue("${direct.info.queue}"), //
            key = {"info"},
            exchange = @Exchange(name = "${log.direct}", type = ExchangeTypes.DIRECT)
    ))
    public void handlerMessage(String msg) {
        System.out.println("info===>s收到的消息：" + msg);
    }
}
